<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jwt鉴权测试</title>
    <script type="text/javascript" src="/common/require.min.js"></script>
    <script type="text/javascript" src="/common/requireConfig.js"></script>
    <script type="text/javascript">
        /**
         * 需要进行权限控制的页面，引入下面的脚本，通过authService.doAuth()检查权限状态，
         * 如果鉴权失败，则跳转至登陆页面
         */
        require(["authService"], function (authService) {
            function failCallBack(){
                authService.toLogin();
            }
            authService.doAuth(successCallback,failCallBack);
        });

        function successCallback(){
            testQuery();
            testQuery2();
        }


        function testQuery(){
            jQuery.ajax({
                url: "http://localhost:50000/postgresql/queryPostgresql",
                type: "POST",
                data:{
                  "sql":"select * from upload_file "
                },
                beforeSend: function (xhr, request) {
                },
                success: function (resultData) {

                }
            });
        }
        function testQuery2(){
            jQuery.ajax({
                url: "http://localhost:9999/PRODUCER-POSTGRESQL/postgresql/queryPostgresql",
                type: "POST",
                data:{
                    "sql":"select * from upload_file "
                },
                beforeSend: function (xhr, request) {
                },
                success: function (resultData) {

                }
            });
        }
    </script>
</head>
<body>

</body>
</html>